package org.forever.framework.web.action;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class BaseAction extends ActionSupport implements Preparable{
	private static final String UTF_8 = "UTF-8";

	private static final long serialVersionUID = 1572957482621891651L;
		
	protected HttpServletRequest request;
	protected HttpServletResponse response;
	protected PrintWriter out;
	
	public void prepare() throws Exception {
		request = ServletActionContext.getRequest();
		response = ServletActionContext.getResponse();
		response.setCharacterEncoding(UTF_8);
		out = response.getWriter();
	}
	
}
